<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            margin: 0;
            background-color: #333333;
        }
        img{
            position: absolute;
        }
    </style>
</head>
<body>
<script src="../js/jquery-1.4.2.js"></script>
<script>
    setInterval(function () {
        let w=$(window).width()
        let h=$(window).height()
        let img=$('<img src="zombies/snow.png">')
        //雪花尺寸 随机20-40个像素  雪花越小移动速度越快
        let width=parseInt(Math.random()*21)+20
        let left=parseInt(Math.random()*(w-width))
        img.css({'left':left})
        img.css({'width':width+'px'})
        $('body').append(img)
        img.animate({'top':h-width},2000*width/40)
        .fadeOut(function () {
            img.remove()
        })
    },10)
</script>
</body>
</html>